package com.kawa.kemanage.exception;

/**
 * @Author: KAIyo
 * @Date: 2025/6/9 19:27
 * @Version: v1.0.0
 * @Description: TODO
 **/
public class BadSqlException extends Exception{
    private final String transactionId;
    private final String sql;

    public BadSqlException(String transactionId, String sql, String message) {
        super(message);
        this.transactionId = transactionId;
        this.sql = sql;
    }

    public BadSqlException(String transactionId, String sql,String message, Throwable cause) {
        super(message, cause);
        this.transactionId = transactionId;
        this.sql = sql;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public String getSql() {
        return sql;
    }

    @Override
    public String toString() {
        return "BadSqlException{" +
                "transactionId:'" + transactionId + '\'' +
                ", sql:'" + sql + '\'' + "message:" + this.getMessage() +
                '}';
    }
}
